﻿/*此版本不进行回复嵌套！
 2011-03-29
 */
using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using Yu.Cms.Common;
using FreshClickMedia.Web.UI.WebControls;

namespace Yu.Cms.Web.UserCtrl.Default
{
    public partial class CommentYes : BaseCtrl
    {
        protected static int PostID = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                PostID = YuRequest.GetQueryInt("PostID");
                this.OnStart();
            }
        }

        protected void OnStart()
        {
            lblCount.Text = bllComment.GetCommentCount(PostID).ToString();
            this.BindList();
        }

        
        /// <summary>
        /// 绑定
        /// </summary>
        protected void BindList()
        {
            int RecordCount;
            rpt1.DataSource = bllComment.GetList(PostID, Pager.CurrentPageIndex, Pager.PageSize, out RecordCount);
            rpt1.DataBind();
            Pager.RecordCount = RecordCount;
        }

        /// <summary>
        /// 翻页
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>      
        protected void Pager_PageChanged(object sender, EventArgs e)
        {
            this.BindList();
        }

       
    }
}